//
//  UITabBarItem.h
//  UIKit
//
//  Copyright (c) 2008-2011, Apple Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIBarItem.h>
#import <UIKit/UIGeometry.h>
#import <UIKit/UIKitDefines.h>

typedef enum {
    UITabBarSystemItemMore,
    UITabBarSystemItemFavorites,
    UITabBarSystemItemFeatured,
    UITabBarSystemItemTopRated,
    UITabBarSystemItemRecents,
    UITabBarSystemItemContacts,
    UITabBarSystemItemHistory,
    UITabBarSystemItemBookmarks,
    UITabBarSystemItemSearch,
    UITabBarSystemItemDownloads,
    UITabBarSystemItemMostRecent,
    UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

@class UIView, UIImage;

UIKIT_CLASS_AVAILABLE(2_0) @interface UITabBarItem : UIBarItem {
@private
    NSString     *_title;
    NSSet        *_possibleTitles;
    SEL           _action;
    id            _target;
    UIImage      *_image;
    UIImage      *_selectedImage;
    UIImage      *_unselectedImage;
    UIEdgeInsets  _imageInsets;
    NSString     *_badgeValue;
    UIView       *_view;
    NSInteger     _tag;
    id            _appearanceStorage;
    struct {
	unsigned int enabled:1;
	unsigned int style:3;
	unsigned int isSystemItem:1;
	unsigned int systemItem:7;
	unsigned int viewIsCustom:1;
	unsigned int animatedBadge:1;
	unsigned int customSelectedImage:1;
	unsigned int customUnselectedImage:1;
    } _tabBarItemFlags;
}

/* Selected and unselected images are autogenerated from the image argument. For full control of
  the selected and unselected images, use -setFinishedSelectedImage:withFinishedUnselectedImage:.
 */
- (id)initWithTitle:(NSString *)title image:(UIImage *)image tag:(NSInteger)tag;
- (id)initWithTabBarSystemItem:(UITabBarSystemItem)systemItem tag:(NSInteger)tag;

@property(nonatomic,copy) NSString *badgeValue;    // default is nil

/* UIKit will not provide any automatic treatment to finished images. You must provide finished selected
 and unselected images in matching pairs for good results. Note that these methods are not tagged
 UI_APPEARANCE_SELECTOR and do not participate in the UIAppearance Proxy API.
 */
- (void)setFinishedSelectedImage:(UIImage *)selectedImage withFinishedUnselectedImage:(UIImage *)unselectedImage __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0);
- (UIImage *)finishedSelectedImage __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0);
- (UIImage *)finishedUnselectedImage __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0);

/* To set item label text attributes use the appearance selectors available on the superclass, UIBarItem.

   Use the following to tweak the relative position of the label within the tab button (for handling visual centering corrections if needed because of custom text attributes)
 */
- (void)setTitlePositionAdjustment:(UIOffset)adjustment __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0) UI_APPEARANCE_SELECTOR; 
- (UIOffset)titlePositionAdjustment __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0) UI_APPEARANCE_SELECTOR;

@end
